<template>
	<view class="">
		<custom-header title="会议资料"></custom-header>
		<view class="content">
			<view class="text">
				<rich-text :nodes="content"></rich-text>
				<view class="hyzl" v-if="fileUrl!=''">
					<text>会议相关文件</text>
					<view v-for="(item,index) in fileUrl">
						<text>{{item.file_name}}</text>
						<text @click="toDownload(item.file_name,item.file_url)">下载</text>
					</view>
				</view>
			</view>
			<view class="bottom"></view>
			<custom-tabbar></custom-tabbar>
		</view>
	</view>
</template>

<script>
	import {
		information
	} from "../../api/fan/index.js"
	export default {
		data() {
			return {
				content: '',
				fileUrl: [],
				fileType: '2',
				id: 1,
			}
		},
		onLoad() {
			this.id = uni.getStorageSync("id")
			this.information();
		},
		methods: {
			toDownload(name, href) {
				const a = document.createElement('a');
				a.setAttribute('href', href);
				a.setAttribute('download', name);
				a.click();
			},
			information() {
				let that = this;
				information(that.id).then(res => {
					if (res.data.code == 200) {
						that.content = res.data.data.content
						that.fileUrl = res.data.data.file_url
						console.log(res.data.data)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f5fffe;
		background: url(../../static/index/Group.png) no-repeat;
		background-attachment: fixed;
		background-position: -180upx 450upx;
	}

	rich-text {
		p {
			color: rgb(41, 64, 58)
		}
	}

	.material-button {
		// width: 10%;
		// height: 50%;
		text-align: center;
		background-color: #457e82;
		color: white;
	}

	.u-button {
		width: 10%;
	}

	/deep/ .u-button__text {
		font-size: 1rem !important
	}


	.text {
		padding: 30upx 30upx 30upx 30upx;
		border-radius: 30rpx;
		margin-top: 120rpx;
		background-color: rgba(255, 255, 255, 0.6) !important;

		view {
			font-size: 36upx;
			line-height: 70upx;
			font-weight: 600;
			margin: 30upx 0;
		}
	}

	.content {
		.text {

			view,
			text,
			p {
				background-color: rgba(255, 255, 255, 0.4) !important;
			}
		}
	}

	p {
		margin: 10upx 0;
		font-weight: 600;
		font-size: 32upx;
		letter-spacing: 2upx;
	}

	.dyb {
		border-bottom: 2rpx solid #4bcc99;
		color: #394f49;
	}

	.content {
		padding: 0 30rpx 200rpx 30rpx;
		border-radius: 0 0 80upx 80upx;
		background-color: rgba(255, 255, 255, 0.1) !important;

		.text {
			background-color: white;
		}
	}

	.hyzl {
		uni-text {
			color: rgb(41, 64, 58)
		}

		padding: 30rpx;

		view {
			font-size: 36upx;
			line-height: 40upx;
			font-weight: 600;
			margin: 30upx 0;
			display: flex;
			justify-content: space-between;
		}

		text:last-child {
			padding-left: 30rpx;
			color: #59b6b9;
		}
	}
</style>